import { Request, Response } from 'express';

const queryRule = (req:Request,res:Response) =>{
  const list = [
    {id:1,name:'管理员',page:'1,2,3',make:'1,2,3'},
    {id:2,name:'财务',page:'2',make:'4,2,3'},
    {id:3,name:'客服',page:'3',make:'3,5,6'},
    {id:4,name:'人事',page:'4,5,6',make:'5,6'},
  ]
  res.send({data:list,status:200})
}

const queryPage = (req:Request,res:Response) =>{
  const list = [
    {id:1,name:'系统管理',parentId:0},
    {id:2,name:'角色管理',parentId:1},
    {id:3,name:'权限管理',parentId:1},
    {id:4,name:'网络管理',parentId:0},
    {id:5,name:'主机管理',parentId:4},
    {id:6,name:'设备管理',parentId:4},
  ]
  res.send({data:list,status:200})
}

const queryMake = (req:Request,res:Response) =>{
  const list = [
    {id:1,name:'添加角色',pageId:2},
    {id:2,name:'删除角色',pageId:2},
    {id:3,name:'修改权限',pageId:3},
    {id:4,name:'添加主机',pageId:5},
    {id:5,name:'修改主机',pageId:5},
    {id:6,name:'添加设备',pageId:6},
  ]
  res.send({data:list,status:200})
}

export default {
  'GET /api/rule': queryRule,
  'GET /api/page': queryPage,
  'GET /api/make': queryMake
}
